Skip to content

Logic gates

![Alt text](../10.1 Boolean Logic/image.png)

NOT gate

Description

  • The output, X, is 1 if the input A is NOT 1

How to write this

  • X = NOT A (logic notation)
  • X=A (Boolean algebra)

Truth table

InputOutput
AX
01
10

AND gate

Description

  • The output, X, is 1 if input A is 1 and input B is 1

How to write this

  • X = A AND B (logic notation)
  • X=AB (Boolean algebra)

Truth table

InputInputOutput
ABX
000
010
100
111

OR gate

Description

  • The output, X, is 1 if input A is 1 or input B is 1.

How to write this

  • X = A OR B (logic notation)

  • X=A+B (Boolean algebra)

Truth table

InputInputOutput
ABX
000
011
101
111

NAND gate

Description

  • The output, X, is 1 if input A is NOT 1 or input B is NOT 1.

How to write this

  • X = A NAND B (logic notation)

  • X=AB (Boolean algebra)

Truth table

InputInputOutput
ABX
001
011
101
110

NOR gate

Description

  • The output, X, is 1 if: input A is NOT 1 and input B is NOT 1

How to write this

  • X = A NOR B (logic notation)

  • X=A+B (Boolean algebra)

Truth table

InputInputOutput
ABX
001
010
100
110

XOR gate

Description

  • The output, X, is 1 if (input A is 1 AND input B is NOT 1) OR (input A is NOT 1 AND input B is 1)

How to write this

  • X = A XOR B (logic notation)
  • X=(AB)+(AB) (Boolean algebra)

(Note: this is sometimes written as: (A+B)(AB))

Truth table

InputInputOutput
ABX
000
011
101
110